<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head th:include="_meta :: header">
    <title>列表</title>
</head>
<body>
<div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">列表</a>
            <a>
              <cite>管理</cite></a>
          </span>
    <a class="layui-btn layui-btn-small" style="float: right;height: 30px;line-height: 30px;margin-top: 5px;" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form action="#" class="layui-form layui-col-space5" th:action="@{/sign/sign}" method="post">
<!--                                    <div class="layui-inline ">-->
<!--                                    <input type="text"  step="0.001" class="layui-input"  th:value="${searchInfo.userId}" name="userId" placeholder="搜索打卡人员id" id="userId" />-->
<!--                                    </div>-->
                                    <div class="layui-inline ">
<!--                                    <input type="text"  step="0.001" class="layui-input"  th:value="${searchInfo.classId}" name="classId" placeholder="搜索班级编号" id="classId" />-->
                                        <select name="classId" th:field="${searchInfo.classId}">
                                            <option value="">全部班级</option>
                                            <option th:each="p:${normalClass}"
                                                    th:text="${p.className}"
                                                    th:value="${p.id}">
                                            </option>
                                        </select>
                                    </div>
                                    
                                    <div class="layui-inline ">
<!--                                    <input type="text"  step="0.001" class="layui-input"  th:value="${searchInfo.signStatus}" name="signStatus" placeholder="搜索打卡状态1代表已打卡" id="signStatus" />-->
                                            <input th:field="${searchInfo.signStatus}" name="signStatus" type="radio" th:value="1" title="已打卡"/>
                                            <input th:field="${searchInfo.signStatus}" name="signStatus" type="radio" th:value="0" title="未打卡"/>
                                    </div>
                                   <div class="layui-inline ">
                                        <input type="text" class="layui-input timeSpace" placeholder="打卡时间" name="createTimeSpace" th:value="${createTimeSpace}"/>
                                    </div>

                                    <div class="layui-inline" >
<!--                                            <input  type="checkbox" name="timeSpace" lay-skin="primary" title="上午" th:value="0">-->
<!--                                            <input  type="checkbox" name="timeSpace" lay-skin="primary" title="下午" th:value="1">-->
<!--                                            <input  type="checkbox" name="timeSpace" lay-skin="primary" title="晚上" th:value="2">-->
                                            <input type="radio" name="stimeSpace" title="上午" th:value="0" th:field="${searchInfo.stimeSpace}"/>
                                            <input type="radio" name="stimeSpace" title="下午" th:value="1" th:field="${searchInfo.stimeSpace}"/>
                                            <input type="radio" name="stimeSpace" title="晚上" th:value="2" th:field="${searchInfo.stimeSpace}"/>
                                            <input type="radio" name="stimeSpace" title="全天" th:value="3" th:field="${searchInfo.stimeSpace}"/>
                                    </div>
<!--                                   <div class="layui-inline ">-->
<!--                                        <input type="text" class="layui-input timeSpace" placeholder="搜索删除时间" name="deleteTimeSpace" th:value="${deleteTimeSpace}" />-->
<!--                                   </div>-->
<!--                                    <div class="layui-inline ">-->
<!--                                    <input type="text"  step="0.001" class="layui-input"  th:value="${searchInfo.deleteStatus}" name="deleteStatus" placeholder="搜索删除状态（0不为删除，1为删除）" id="deleteStatus" />-->
<!--                                    </div>-->
                        <div class="layui-inline">
                            <button type="submit" class="layui-btn  layui-btn-success radius"><i class="layui-icon">&#xe615;</i>
                            </button>
                        </div>
                        <div class="cl pd-5 bg-1 bk-gray " >
							<span class="l">
                                <a href="javascript:;"
                                   onclick="deleteAll('/sign/sign/deleteAll')"
                                   class="layui-btn  layui-btn-danger radius"><i class="layui-icon">&#xe64d;</i> 批量删除</a>
<!--						<a href="javascript:;"-->
<!--                           onclick="layer_show('添加','/sign/sign/addBefore',900,500)"-->
<!--                           class="layui-btn  layui-btn-normal radius"><i class="layui-icon">&#xe600;</i> 添加</a>-->
							</span>
                            <span class="r wei-height" style="float: right;margin-right: 20px">共有数据：<strong
                                        th:text="${pageInfo.total}"></strong> 条</span>
                        </div>
                        <div class="layui-card-body" style="text-align: center">
                            <table class="layui-table layui-form">
                                <thead>
                                <tr class="text-c">
                                    <th width="25"><input type="checkbox" name="" value="" lay-filter="checkall" lay-skin="primary"/></th>
                                    <th width="25">序号</th>
                                        <th width="40">班级名称</th>
                                        <th width="40">打卡人员</th>
                                        <th width="40">打卡状态</th>
                                        <th width="40">打卡时间</th>
<!--                                        <th width="40">删除时间</th>-->
<!--                                        <th width="40">删除状态（0不为删除，1为删除）</th>-->
                                    <th width="100">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr class="text-c" th:if="${pageInfo.list.size() == 0}">
                                    <td colspan="15"><strong>暂无数据</strong></td>
                                </tr>
                                <tr class="text-c" th:each="sign,count:${pageInfo.list}">
                                    <td><input type="checkbox" value="1" th:value="${sign.id}"
                                               name="id" lay-skin="primary"/></td>
                                    <td th:text="${count.count}"></td>
                                                <td th:text="${sign.className}"></td>
                                                <td th:text="${sign.name}"></td>
                                    <td th:if = "${sign.signStatus} eq 1" th:text="已打卡" style="color: green"></td>
                                    <td th:if = "${sign.signStatus} eq 0" th:text="未打卡" style="color: red"></td>
                                            <td th:text="${#temporals.format(sign.createTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
<!--                                            <td th:text="${#temporals.format(sign.deleteTime, 'yyyy-MM-dd HH:mm:ss')}"></td>-->
<!--                                                <td th:text="${sign.deleteStatus}"></td>-->
                                    <td class="td-manage">
                                        <a title="编辑" href="javascript:;"
                                           th:onclick="'javascript:layer_show(\'编辑\',\'/sign/'+'sign'+'/editBefore/'+${sign.id}+'\',900,500)'"
                                           class="ml-5" style="text-decoration:none">修改打卡记录</a>
<!--                                        <a title="删除" href="javascript:;"-->
<!--                                           th:onclick="'javascript:deleteById(\'/sign/'+'sign'+'/delete/'+${sign.id}+'\')'"-->
<!--                                           class="ml-5" style="text-decoration:none"><i class="layui-icon">&#xe640;</i></a>-->
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div th:include="_pagination :: page"></div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<!--_footer 作为公共模版分离出去-->
<div th:replace="_footer :: footerjs">
</div>
<!--/_footer 作为公共模版分离出去-->
<script>
    layui.use(['laydate','form'], function(){
        var laydate = layui.laydate;
        var form = layui.form;
        // 监听全选
        form.on('checkbox(checkall)', function(data){

            if(data.elem.checked){
                $('tbody input').prop('checked',true);
            }else{
                $('tbody input').prop('checked',false);
            }
            form.render('checkbox');
        });
        form.on('select(selectchange)', function(data){
            console.log(data.value); //得到被选中的值
            var pageNo = $('#pageNo');
            var Form = $('form')
            pageNo.val(1);
            Form.submit();
            form.render('select');
        });
        //日期时间范围选择
        laydate.render({

        });
        lay('.timeSpace').each(function(){
            laydate.render({
                elem: this
                ,type: 'date'
                ,format: 'yyyy-MM-dd'
            });
        });
    });


</script>
</body>
</html>